home *** CD-ROM | disk | FTP | other *** search
-
- LISTING 2
-
- /* routine to read data that is
- available on the network descriptor
- nd. reads len bytes of data.
- */
-
- #define BUFFSIZE 512
-
- void read_data(int nd)
- {
- char buffer[BUFFSIZE];
-
- do {
- len = net_read(nd,
- buffer, BUFFSIZE,
- (struct addr *) NULL, 0);
- if (len < 0)
- pneterror("net_read");
- else
- write(file, buffer, len);
- } while (len >= 0);
- }
-
-